﻿// Copyright (c) Vitaly Kamiansky. All rights reserved. 
// See License.txt in the project root.

using System;

namespace Property.Reloaders
{
    public partial class CallbackReloaderPrototype<T> : ReloaderPrototype<T>
    {
        public CallbackReloaderPrototype(IWorkerPrototype<T> workerPrototype)
        {
            _WorkerPrototype = workerPrototype;
        }

        //=//

        private readonly IWorkerPrototype<T> _WorkerPrototype;

        public override IReloader Create(Func<T> getValue, Action<T> applyValue, Action<bool> applyStatus)
        {
            return new ReloaderInstance(_WorkerPrototype, getValue, applyValue, applyStatus);
        }
    }
}
